import 'package:flutter/material.dart';

class CardBottomTitleWidget extends StatelessWidget {
  final double height;
  final double bottomHeight;
  final Color? bottomColor;
  final TextStyle bottomTextStyle;
  final String bottomText;
  final Widget content;
  final GestureTapCallback onTap;

  const CardBottomTitleWidget({
    Key? key,
    required this.content,
    required this.bottomText,
    required this.onTap,
    this.height = 90,
    this.bottomHeight = 24,
    this.bottomColor,
    this.bottomTextStyle = const TextStyle(
      fontSize: 13,
      fontWeight: FontWeight.w500,
      color: Colors.white,
    ),
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: onTap,
      child: SizedBox(
        height: height,
        child: Card(
          child: Column(
            children: <Widget>[
              Expanded(child: content),
              Container(
                color: bottomColor ?? Theme.of(context).primaryColor,
                height: bottomHeight,
                width: double.infinity,
                child: Center(
                  child: Text(
                    bottomText,
                    style: bottomTextStyle,
                    textAlign: TextAlign.center,
                  ),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
